package com.agricultural.state.impl;

import com.agricultural.equipment.AgriculturalEquipment;
import com.agricultural.state.EquipmentState;

// 维护状态类
public class MaintenanceState implements EquipmentState {
    private AgriculturalEquipment equipment; // 设备引用
    
    // 构造函数
    public MaintenanceState(AgriculturalEquipment equipment) {
        this.equipment = equipment;
    }
    
    // 获取状态名称
    @Override
    public String getStateName() {
        return "维护中";
    }
    
    // 启动设备
    @Override
    public void start() {
        System.out.println("[" + equipment.getType() + "-" + equipment.getId() + "] 维护尚未完成，无法启动");
    }
    
    // 停止设备
    @Override
    public void stop() {
        System.out.println("[" + equipment.getType() + "-" + equipment.getId() + "] 已经处于维护状态");
    }
    
    // 执行作业
    @Override
    public void executeWork() {
        System.out.println("[" + equipment.getType() + "-" + equipment.getId() + "] 正在维护中，无法执行作业");
    }
    
    // 获取设备
    @Override
    public AgriculturalEquipment getEquipment() {
        return equipment;
    }
}    